<?php
/*
|--------------------------------------------------------------------------
| Admin Routes
|--------------------------------------------------------------------------
|
| 后台公共路由部分
|
*/
Route::group(['namespace'=>'Admin','prefix'=>'admin'],function (){
    //登录、注销
    Route::get('login','LoginController@showLoginForm')->name('admin.loginForm');
    Route::post('login','LoginController@login')->name('admin.login');
    Route::get('logout','LoginController@logout')->name('admin.logout');

});


/*
|--------------------------------------------------------------------------
| Admin Routes
|--------------------------------------------------------------------------
|
| 后台需要授权的路由 admins
|
*/
Route::group(['namespace'=>'Admin','prefix'=>'admin','middleware'=>'auth'],function (){
    //后台布局
    Route::get('/','IndexController@layout')->name('admin.layout');
    //后台首页
    Route::get('/index','IndexController@index')->name('admin.index');
    Route::get('/index1','IndexController@index1')->name('admin.index1');
    Route::get('/index2','IndexController@index2')->name('admin.index2');
    //图标
    Route::get('icons','IndexController@icons')->name('admin.icons');
});

//系统管理
Route::group(['namespace'=>'Admin','prefix'=>'admin','middleware'=>['auth','permission:system.manage']],function (){
    //数据表格接口
    Route::get('data','IndexController@data')->name('admin.data')->middleware('permission:system.role|system.user|system.permission');
    //用户管理
    Route::group(['middleware'=>['permission:system.user']],function (){
        Route::get('user','UserController@index')->name('admin.user');
        //添加
        Route::get('user/create','UserController@create')->name('admin.user.create')->middleware('permission:system.user.create');
        Route::post('user/store','UserController@store')->name('admin.user.store')->middleware('permission:system.user.create');
        //编辑
        Route::get('user/{id}/edit','UserController@edit')->name('admin.user.edit')->middleware('permission:system.user.edit');
        Route::put('user/{id}/update','UserController@update')->name('admin.user.update')->middleware('permission:system.user.edit');
        //删除
        Route::delete('user/destroy','UserController@destroy')->name('admin.user.destroy')->middleware('permission:system.user.destroy');
        //分配角色
        Route::get('user/{id}/role','UserController@role')->name('admin.user.role')->middleware('permission:system.user.role');
        Route::put('user/{id}/assignRole','UserController@assignRole')->name('admin.user.assignRole')->middleware('permission:system.user.role');
        //分配权限
        Route::get('user/{id}/permission','UserController@permission')->name('admin.user.permission')->middleware('permission:system.user.permission');
        Route::put('user/{id}/assignPermission','UserController@assignPermission')->name('admin.user.assignPermission')->middleware('permission:system.user.permission');
    });
    //角色管理
    Route::group(['middleware'=>'permission:system.role'],function (){
        Route::get('role','RoleController@index')->name('admin.role');
        //添加
        Route::get('role/create','RoleController@create')->name('admin.role.create')->middleware('permission:system.role.create');
        Route::post('role/store','RoleController@store')->name('admin.role.store')->middleware('permission:system.role.create');
        //编辑
        Route::get('role/{id}/edit','RoleController@edit')->name('admin.role.edit')->middleware('permission:system.role.edit');
        Route::put('role/{id}/update','RoleController@update')->name('admin.role.update')->middleware('permission:system.role.edit');
        //删除
        Route::delete('role/destroy','RoleController@destroy')->name('admin.role.destroy')->middleware('permission:system.role.destroy');
        //分配权限
        Route::get('role/{id}/permission','RoleController@permission')->name('admin.role.permission')->middleware('permission:system.role.permission');
        Route::put('role/{id}/assignPermission','RoleController@assignPermission')->name('admin.role.assignPermission')->middleware('permission:system.role.permission');
    });
    //权限管理
    Route::group(['middleware'=>'permission:system.permission'],function (){
        Route::get('permission','PermissionController@index')->name('admin.permission');
        //添加
        Route::get('permission/create','PermissionController@create')->name('admin.permission.create')->middleware('permission:system.permission.create');
        Route::post('permission/store','PermissionController@store')->name('admin.permission.store')->middleware('permission:system.permission.create');
        //编辑
        Route::get('permission/{id}/edit','PermissionController@edit')->name('admin.permission.edit')->middleware('permission:system.permission.edit');
        Route::put('permission/{id}/update','PermissionController@update')->name('admin.permission.update')->middleware('permission:system.permission.edit');
        //删除
        Route::delete('permission/destroy','PermissionController@destroy')->name('admin.permission.destroy')->middleware('permission:system.permission.destroy');
    });
    //菜单管理
//    Route::group(['middleware'=>'permission:system.menu'],function (){
//        Route::get('menu','MenuController@index')->name('admin.menu');
//        Route::get('menu/data','MenuController@data')->name('admin.menu.data');
//        //添加
//        Route::get('menu/create','MenuController@create')->name('admin.menu.create')->middleware('permission:system.menu.create');
//        Route::post('menu/store','MenuController@store')->name('admin.menu.store')->middleware('permission:system.menu.create');
//        //编辑
//        Route::get('menu/{id}/edit','MenuController@edit')->name('admin.menu.edit')->middleware('permission:system.menu.edit');
//        Route::put('menu/{id}/update','MenuController@update')->name('admin.menu.update')->middleware('permission:system.menu.edit');
//        //删除
//        Route::delete('menu/destroy','MenuController@destroy')->name('admin.menu.destroy')->middleware('permission:system.menu.destroy');
//    });
});


//资讯管理
Route::group(['namespace' => 'Admin', 'prefix' => 'admin', 'middleware' => ['auth', 'permission:zixun.manage']], function () {
    //分类管理
    Route::group(['middleware' => 'permission:zixun.category'], function () {
        Route::get('category/data', 'CategoryController@data')->name('admin.category.data');
        Route::get('category', 'CategoryController@index')->name('admin.category');
        //添加分类
        Route::get('category/create', 'CategoryController@create')->name('admin.category.create')->middleware('permission:zixun.category.create');
        Route::post('category/store', 'CategoryController@store')->name('admin.category.store')->middleware('permission:zixun.category.create');
        //编辑分类
        Route::get('category/{id}/edit', 'CategoryController@edit')->name('admin.category.edit')->middleware('permission:zixun.category.edit');
        Route::put('category/{id}/update', 'CategoryController@update')->name('admin.category.update')->middleware('permission:zixun.category.edit');
        //删除分类
        Route::delete('category/destroy', 'CategoryController@destroy')->name('admin.category.destroy')->middleware('permission:zixun.category.destroy');
    });
    //文章管理
    Route::group(['middleware' => 'permission:zixun.article'], function () {
        Route::get('article/data', 'ArticleController@data')->name('admin.article.data');
        Route::get('article', 'ArticleController@index')->name('admin.article');
        //添加
        Route::get('article/create', 'ArticleController@create')->name('admin.article.create')->middleware('permission:zixun.article.create');
        Route::post('article/store', 'ArticleController@store')->name('admin.article.store')->middleware('permission:zixun.article.create');
        //编辑
        Route::get('article/{id}/edit', 'ArticleController@edit')->name('admin.article.edit')->middleware('permission:zixun.article.edit');
        Route::put('article/{id}/update', 'ArticleController@update')->name('admin.article.update')->middleware('permission:zixun.article.edit');
        //删除
        Route::delete('article/destroy', 'ArticleController@destroy')->name('admin.article.destroy')->middleware('permission:zixun.article.destroy');
        // 楼盘
        Route::get('article/getProperty', 'ArticleController@getProperty')->name('admin.article.getProperty');
        Route::get('article/selProperty', 'ArticleController@selProperty')->name('admin.article.selProperty');
    });
    //标签管理
    Route::group(['middleware' => 'permission:zixun.tag'], function () {
        Route::get('tag/data', 'TagController@data')->name('admin.tag.data');
        Route::get('tag', 'TagController@index')->name('admin.tag');
        //添加
        Route::get('tag/create', 'TagController@create')->name('admin.tag.create')->middleware('permission:zixun.tag.create');
        Route::post('tag/store', 'TagController@store')->name('admin.tag.store')->middleware('permission:zixun.tag.create');
        //编辑
        Route::get('tag/{id}/edit', 'TagController@edit')->name('admin.tag.edit')->middleware('permission:zixun.tag.edit');
        Route::put('tag/{id}/update', 'TagController@update')->name('admin.tag.update')->middleware('permission:zixun.tag.edit');
        //删除
        Route::delete('tag/destroy', 'TagController@destroy')->name('admin.tag.destroy')->middleware('permission:zixun.tag.destroy');
    });
});
//配置管理
Route::group(['namespace' => 'Admin', 'prefix' => 'admin', 'middleware' => ['auth', 'permission:config.manage']], function () {
    //站点配置
    Route::group(['middleware' => 'permission:config.site'], function () {
        Route::get('site', 'SiteController@index')->name('admin.site');
        Route::put('site', 'SiteController@update')->name('admin.site.update')->middleware('permission:config.site.update');
    });
    //广告位
    Route::group(['middleware' => 'permission:config.position'], function () {
        Route::get('position/data', 'PositionController@data')->name('admin.position.data');
        Route::get('position', 'PositionController@index')->name('admin.position');
        //添加
        Route::get('position/create', 'PositionController@create')->name('admin.position.create')->middleware('permission:config.position.create');
        Route::post('position/store', 'PositionController@store')->name('admin.position.store')->middleware('permission:config.position.create');
        //编辑
        Route::get('position/{id}/edit', 'PositionController@edit')->name('admin.position.edit')->middleware('permission:config.position.edit');
        Route::put('position/{id}/update', 'PositionController@update')->name('admin.position.update')->middleware('permission:config.position.edit');
        //删除
        Route::delete('position/destroy', 'PositionController@destroy')->name('admin.position.destroy')->middleware('permission:config.position.destroy');
    });
    //广告信息
    Route::group(['middleware' => 'permission:config.advert'], function () {
        Route::get('advert/data', 'AdvertController@data')->name('admin.advert.data');
        Route::get('advert', 'AdvertController@index')->name('admin.advert');
        //添加
        Route::get('advert/create', 'AdvertController@create')->name('admin.advert.create')->middleware('permission:config.advert.create');
        Route::post('advert/store', 'AdvertController@store')->name('admin.advert.store')->middleware('permission:config.advert.create');
        //编辑
        Route::get('advert/{id}/edit', 'AdvertController@edit')->name('admin.advert.edit')->middleware('permission:config.advert.edit');
        Route::put('advert/{id}/update', 'AdvertController@update')->name('admin.advert.update')->middleware('permission:config.advert.edit');
        //删除
        Route::delete('advert/destroy', 'AdvertController@destroy')->name('admin.advert.destroy')->middleware('permission:config.advert.destroy');
    });
    // 导航管理
    Route::group(['middleware' => 'permission:config.navigation'], function () {
        Route::get('navigation/data', 'NavigationController@data')->name('admin.navigation.data');
        Route::get('navigation', 'NavigationController@index')->name('admin.navigation');
        //添加
        Route::get('navigation/create', 'NavigationController@create')->name('admin.navigation.create')->middleware('permission:config.navigation.create');
        Route::post('navigation/store', 'NavigationController@store')->name('admin.navigation.store')->middleware('permission:config.navigation.create');
        //编辑
        Route::get('navigation/{id}/edit', 'NavigationController@edit')->name('admin.navigation.edit')->middleware('permission:config.navigation.edit');
        Route::put('navigation/{id}/update', 'NavigationController@update')->name('admin.navigation.update')->middleware('permission:config.navigation.edit');
        //删除
        Route::delete('navigation/destroy', 'NavigationController@destroy')->name('admin.navigation.destroy')->middleware('permission:config.navigation.destroy');
    });
});
//会员管理
Route::group(['namespace' => 'Admin', 'prefix' => 'admin', 'middleware' => ['auth', 'permission:member.manage']], function () {
    //账号管理
    Route::group(['middleware' => 'permission:member.member'], function () {
        Route::get('member/data', 'MemberController@data')->name('admin.member.data');
        Route::get('member', 'MemberController@index')->name('admin.member');
        //添加
        Route::get('member/create', 'MemberController@create')->name('admin.member.create')->middleware('permission:member.member.create');
        Route::post('member/store', 'MemberController@store')->name('admin.member.store')->middleware('permission:member.member.create');
        //编辑
        Route::get('member/{id}/edit', 'MemberController@edit')->name('admin.member.edit')->middleware('permission:member.member.edit');
        Route::put('member/{id}/update', 'MemberController@update')->name('admin.member.update')->middleware('permission:member.member.edit');
        //删除
        Route::delete('member/destroy', 'MemberController@destroy')->name('admin.member.destroy')->middleware('permission:member.member.destroy');
    });
    // 找房
    Route::group(['middleware' => 'permission:member.findhouse'], function () {
        Route::get('member/findhouse/data', 'FindhouseController@data')->name('admin.member.findhouse.data');
        Route::get('member/findhouse', 'FindhouseController@index')->name('admin.member.findhouse');
        //编辑
        Route::get('member/findhouse/{id}/edit', 'FindhouseController@edit')->name('admin.member.findhouse.edit')->middleware('permission:member.findhouse.edit');
        Route::put('member/findhouse/{id}/update', 'FindhouseController@update')->name('admin.member.findhouse.update')->middleware('permission:member.findhouse.edit');
        //删除
        Route::delete('member/findhouse/destroy', 'FindhouseController@destroy')->name('admin.member.findhouse.destroy')->middleware('permission:member.findhouse.destroy');
    });
    // 预约看房
    Route::group(['middleware' => 'permission:member.showings'], function () {
        Route::get('member/showings/data', 'ShowingsController@data')->name('admin.member.showings.data');
        Route::get('member/showings', 'ShowingsController@index')->name('admin.member.showings');
        //编辑
        Route::get('member/showings/{id}/edit', 'ShowingsController@edit')->name('admin.member.showings.edit')->middleware('permission:member.showings.edit');
        Route::put('member/showings/{id}/update', 'ShowingsController@update')->name('admin.member.showings.update')->middleware('permission:member.showings.edit');
        //删除
        Route::delete('member/showings/destroy', 'ShowingsController@destroy')->name('admin.member.showings.destroy')->middleware('permission:member.showings.destroy');
    });
});
//消息管理
Route::group(['namespace' => 'Admin', 'prefix' => 'admin', 'middleware' => ['auth', 'permission:message.manage']], function () {
    //消息管理
    Route::group(['middleware' => 'permission:message.message'], function () {
        Route::get('message/data', 'MessageController@data')->name('admin.message.data');
        Route::get('message/getUser', 'MessageController@getUser')->name('admin.message.getUser');
        Route::get('message', 'MessageController@index')->name('admin.message');
        //添加
        Route::get('message/create', 'MessageController@create')->name('admin.message.create')->middleware('permission:message.message.create');
        Route::post('message/store', 'MessageController@store')->name('admin.message.store')->middleware('permission:message.message.create');
        //删除
        Route::delete('message/destroy', 'MessageController@destroy')->name('admin.message.destroy')->middleware('permission:message.message.destroy');
        //我的消息
        Route::get('mine/message', 'MessageController@mine')->name('admin.message.mine')->middleware('permission:message.message.mine');
        Route::post('message/{id}/read', 'MessageController@read')->name('admin.message.read')->middleware('permission:message.message.mine');

        Route::get('message/count', 'MessageController@getMessageCount')->name('admin.message.get_count');
    });

});

//楼盘管理
Route::group(['namespace' => 'Admin', 'prefix' => 'admin', 'middleware' => ['auth', 'permission:property.manage']], function () {
    //楼盘列表管理
    Route::group(['middleware' => 'permission:property.property'], function () {
        Route::get('property/data', 'PropertyController@data')->name('admin.property.data');
        Route::get('property', 'PropertyController@index')->name('admin.property');
        //添加
        Route::get('property/create', 'PropertyController@create')->name('admin.property.create')->middleware('permission:property.create');
        Route::post('property/store', 'PropertyController@store')->name('admin.property.store')->middleware('permission:property.create');
        //编辑
        Route::get('property/{id}/edit', 'PropertyController@edit')->name('admin.property.edit')->middleware('permission:property.edit');
        Route::put('property/{id}/update', 'PropertyController@update')->name('admin.property.update')->middleware('permission:property.edit');
        //删除
        Route::delete('property/destroy', 'PropertyController@destroy')->name('admin.property.destroy')->middleware('permission:property.destroy');
        // 获取标记
        Route::get('property/position/{city}', 'PropertyController@getLocalPosition')->name('admin.property.position');

    });
    //楼盘相册管理
    Route::group(['middleware' => 'permission:property.album'], function () {
        Route::get('album/data', 'AlbumController@data')->name('admin.album.data');
        Route::get('album', 'AlbumController@index')->name('admin.album');
        //添加
        Route::get('album/create', 'AlbumController@create')->name('admin.album.create')->middleware('permission:property.album.create');
        Route::post('album/store', 'AlbumController@store')->name('admin.album.store')->middleware('permission:property.album.create');
        //编辑
        Route::get('album/{id}/edit', 'AlbumController@edit')->name('admin.album.edit')->middleware('permission:property.album.edit');
        Route::put('album/{id}/update', 'AlbumController@update')->name('admin.album.update')->middleware('permission:property.album.edit');
        //删除
        Route::delete('album/destroy', 'AlbumController@destroy')->name('admin.album.destroy')->middleware('permission:property.album.destroy');
        // 搜索楼盘
        Route::post('album/searchProperty', 'AlbumController@searchProperty')->name('admin.album.search');
    });
    //楼盘户型管理
    Route::group(['middleware' => 'permission:property.apartment'], function () {
        Route::get('apartment/data', 'ApartmentController@data')->name('admin.apartment.data');
        Route::get('apartment', 'ApartmentController@index')->name('admin.apartment');
        //添加
        Route::get('apartment/create', 'ApartmentController@create')->name('admin.apartment.create')->middleware('permission:property.apartment.create');
        Route::post('apartment/store', 'ApartmentController@store')->name('admin.apartment.store')->middleware('permission:property.apartment.create');
        //编辑
        Route::get('apartment/{id}/edit', 'ApartmentController@edit')->name('admin.apartment.edit')->middleware('permission:property.apartment.edit');
        Route::put('apartment/{id}/update', 'ApartmentController@update')->name('admin.apartment.update')->middleware('permission:property.apartment.edit');
        //删除
        Route::delete('apartment/destroy', 'ApartmentController@destroy')->name('admin.apartment.destroy')->middleware('permission:property.apartment.destroy');
        // 搜索楼盘
        Route::post('apartment/searchProperty', 'ApartmentController@searchProperty')->name('admin.apartment.search');

    });

});

//二手/出租管理
Route::group(['namespace' => 'Admin', 'prefix' => 'admin', 'middleware' => ['auth', 'permission:lease.manage']], function () {
    //小区管理
    Route::group(['middleware' => 'permission:lease.community'], function () {
        Route::get('community/data', 'CommunityController@data')->name('admin.community.data');
        Route::get('community', 'CommunityController@index')->name('admin.community');
        //添加
        Route::get('community/create', 'CommunityController@create')->name('admin.community.create')->middleware('permission:community.create');
        Route::post('community/store', 'CommunityController@store')->name('admin.community.store')->middleware('permission:community.create');
        //编辑
        Route::get('community/{id}/edit', 'CommunityController@edit')->name('admin.community.edit')->middleware('permission:community.edit');
        Route::put('community/{id}/update', 'CommunityController@update')->name('admin.community.update')->middleware('permission:community.edit');
        //删除
        Route::delete('community/destroy', 'CommunityController@destroy')->name('admin.community.destroy')->middleware('permission:community.destroy');
        // 查询小区
        Route::get('community/getCommunity', 'CommunityController@getCommunity')->name('admin.community.getCommunity');
        Route::get('community/selCommunity', 'CommunityController@selCommunity')->name('admin.community.selCommunity');
    });
    // 小区成交记录
    Route::group(['middleware' => 'permission:lease.community'], function () {
        Route::get('community_data/data', 'CommunityDataController@data')->name('admin.community_data.data');
        Route::get('community_data', 'CommunityDataController@index')->name('admin.community_data');
        //添加
        Route::get('community_data/create', 'CommunityDataController@create')->name('admin.community_data.create')->middleware('permission:community_data.create');
        Route::post('community_data/store', 'CommunityDataController@store')->name('admin.community_data.store')->middleware('permission:community_data.create');
        //编辑
        Route::get('community_data/{id}/edit', 'CommunityDataController@edit')->name('admin.community_data.edit')->middleware('permission:community_data.edit');
        Route::put('community_data/{id}/update', 'CommunityDataController@update')->name('admin.community_data.update')->middleware('permission:community_data.edit');
        //删除
        Route::delete('community_data/destroy', 'CommunityDataController@destroy')->name('admin.community_data.destroy')->middleware('permission:community_data.destroy');

    });
    //二手房管理
    Route::group(['middleware' => 'permission:lease.handroom'], function () {
        Route::get('handroom/data', 'HandroomController@data')->name('admin.handroom.data');
        Route::get('handroom', 'HandroomController@index')->name('admin.handroom');
        //添加
        Route::get('handroom/create', 'HandroomController@create')->name('admin.handroom.create')->middleware('permission:handroom.create');
        Route::post('handroom/store', 'HandroomController@store')->name('admin.handroom.store')->middleware('permission:handroom.create');
        //编辑
        Route::get('handroom/{id}/edit', 'HandroomController@edit')->name('admin.handroom.edit')->middleware('permission:handroom.edit');
        Route::put('handroom/{id}/update', 'HandroomController@update')->name('admin.handroom.update')->middleware('permission:handroom.edit');
        //删除
        Route::delete('handroom/destroy', 'HandroomController@destroy')->name('admin.handroom.destroy')->middleware('permission:handroom.destroy');
    });
    //出租房管理
    Route::group(['middleware' => 'permission:lease.rentalhouse'], function () {
        Route::get('rentalhouse/data', 'RentalhouseController@data')->name('admin.rentalhouse.data');
        Route::get('rentalhouse', 'RentalhouseController@index')->name('admin.rentalhouse');
        //添加
        Route::get('rentalhouse/create', 'RentalhouseController@create')->name('admin.rentalhouse.create')->middleware('permission:rentalhouse.create');
        Route::post('rentalhouse/store', 'RentalhouseController@store')->name('admin.rentalhouse.store')->middleware('permission:rentalhouse.create');
        //编辑
        Route::get('rentalhouse/{id}/edit', 'RentalhouseController@edit')->name('admin.rentalhouse.edit')->middleware('permission:rentalhouse.edit');
        Route::put('rentalhouse/{id}/update', 'RentalhouseController@update')->name('admin.rentalhouse.update')->middleware('permission:rentalhouse.edit');
        //删除
        Route::delete('rentalhouse/destroy', 'RentalhouseController@destroy')->name('admin.rentalhouse.destroy')->middleware('permission:rentalhouse.destroy');
    });
});
// 模块
Route::group(['namespace' => 'Admin', 'prefix' => 'admin', 'middleware' => ['auth', 'permission:module.manage']], function () {
    //属性管理
    Route::group(['middleware' => 'permission:property.attribute'], function () {
        Route::get('attribute/data', 'AttributeController@data')->name('admin.property.attribute.data');
        Route::get('attribute', 'AttributeController@index')->name('admin.property.attribute');
        //添加分类
        Route::get('attribute/create', 'AttributeController@create')->name('admin.property.attribute.create')->middleware('permission:property.attribute.create');
        Route::post('attribute/store', 'AttributeController@store')->name('admin.property.attribute.store')->middleware('permission:property.attribute.create');
        //编辑分类
        Route::get('attribute/{id}/edit', 'AttributeController@edit')->name('admin.property.attribute.edit')->middleware('permission:property.attribute.edit');
        Route::put('attribute/{id}/update', 'AttributeController@update')->name('admin.property.attribute.update')->middleware('permission:property.attribute.edit');
        //删除分类
        Route::delete('attribute/destroy', 'AttributeController@destroy')->name('admin.property.attribute.destroy')->middleware('permission:property.attribute.destroy');
        //查询城市
        Route::post('attribute/getcity', 'AttributeController@getCity')->name('admin.property.attribute.getCity');
    });

    //地铁线管理
    Route::group(['middleware' => 'permission:module.metro'], function () {
        Route::get('metro/data', 'MetroController@data')->name('admin.metro.data');
        Route::get('metro', 'MetroController@index')->name('admin.metro');
        //添加
        Route::get('metro/create', 'MetroController@create')->name('admin.metro.create')->middleware('permission:metro.create');
        Route::post('metro/store', 'MetroController@store')->name('admin.metro.store')->middleware('permission:metro.create');
        //编辑
        Route::get('metro/{id}/edit', 'MetroController@edit')->name('admin.metro.edit')->middleware('permission:metro.edit');
        Route::put('metro/{id}/update', 'MetroController@update')->name('admin.metro.update')->middleware('permission:metro.edit');
        //删除
        Route::delete('metro/destroy', 'MetroController@destroy')->name('admin.metro.destroy')->middleware('permission:metro.destroy');
        // 查询地铁线
        Route::post('metro/getMetroByCity', 'MetroController@getMetroByCity')->name('admin.metro.getMetroByCity');
    });
    //地铁站点管理
    Route::group(['middleware' => 'permission:module.metro'], function () {
        Route::get('metro_station/data/{id}', 'MetroStationController@data')->name('admin.metro_station.data');
        Route::get('metro_station/{id}', 'MetroStationController@index')->name('admin.metro_station');
        //添加
        Route::get('metro_station/create/{id}', 'MetroStationController@create')->name('admin.metro_station.create')->middleware('permission:metro.create');
        Route::post('metro_station/store', 'MetroStationController@store')->name('admin.metro_station.store')->middleware('permission:metro.create');
        //编辑
        Route::get('metro_station/{id}/edit', 'MetroStationController@edit')->name('admin.metro_station.edit')->middleware('permission:metro.edit');
        Route::put('metro_station/{id}/update', 'MetroStationController@update')->name('admin.metro_station.update')->middleware('permission:metro.edit');
        //删除
        Route::delete('metro_station/destroy', 'MetroStationController@destroy')->name('admin.metro_station.destroy')->middleware('permission:metro.destroy');
        // 查询地铁站
        Route::post('metro/getStation', 'MetroStationController@getStationByMetroId')->name('admin.metro_station.getStation');
    });
    //地区管理
    Route::group(['middleware' => 'permission:module.region'], function () {
        Route::get('region/data', 'RegionController@data')->name('admin.region.data');
        Route::get('region', 'RegionController@index')->name('admin.region');
        //添加
        Route::get('region/create', 'RegionController@create')->name('admin.region.create')->middleware('permission:region.create');
        Route::post('region/store', 'RegionController@store')->name('admin.region.store')->middleware('permission:region.create');
        //编辑
        Route::get('region/{id}/edit', 'RegionController@edit')->name('admin.region.edit')->middleware('permission:region.edit');
        Route::put('region/{id}/update', 'RegionController@update')->name('admin.region.update')->middleware('permission:region.edit');
        //删除
        Route::delete('region/destroy', 'RegionController@destroy')->name('admin.region.destroy')->middleware('permission:region.destroy');
        //查询城市
        Route::post('region/getcity', 'RegionController@getCity')->name('admin.region.getCity');
    });
});